
const { version } = require('../date/date');
const { Myfs } = require('../fs/fs');

// const configPath = './static/config.js';
const versionPath = './static/data/version.json';

const writeVersion = () => {
    // let code =  Myfs.readFile(configPath);
    // code = code.replace(/(VERSION\s*:\s*)['|"](\S*)['|"]/, `$1'${version}'`);
    // Myfs.writeFile(configPath, code);
    Myfs.writeFile(versionPath, `{"version":"${version}"}`);
    return version;
};



module.exports = {
    writeVersion,
};